Seg2

data class Seg2(val start: Vec2, val end: Vec2) : Segment2<Vec2> (source)

Represents a segment in 2D space defined by a start and end point.

Constructors

Link copied to clipboard
constructor(start: Vec2, end: Vec2)

Properties

Link copied to clipboard
open override val end: Vec2

The ending point of the segment.

Link copied to clipboard
open override val start: Vec2

The starting point of the segment.

Functions

Link copied to clipboard
open fun eq(other: Segment2<*>, equivalence: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE): Boolean

Checks if this segment is equal to another segment, considering the order of points irrelevant.

Link copied to clipboard
open fun intersection(other: Segment2<*>, equivalence: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE): IntersectionData<Vec2>

Compute the intersection of this segment with another segment.

Link copied to clipboard
open fun length(): Double

Get the length of the segment.

Link copied to clipboard
open override fun reverse(): Segment2<Vec2>

Reverses the segment, swapping its start and end points.

Link copied to clipboard
open override fun transform(transformer: Transformer<Vec2>): Segment2<Vec2>

Applies a transformation to the endpoints of this segment.